<?php
/**
 * 商品风格
 */
namespace App\Models\MainDB;

use Illuminate\Database\Eloquent\Model;

class ProductsStyle extends Model
{

    protected $table = 'ln_products_style';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        'id',      //主键ID
        'name',
    ];

    public $timestamps = false;

    //获取所有风格标签
    public function getAll($where = [])
    {
        return $this->where($where)->get();
    }

    //获取所有风格标签
    public function getAllIdMap($where = [])
    {
        $data = $this->where($where)->get()->toArray();
        return array_column($data, null, 'id');
    }
}